package com.cn.lf.wx.dacs.bussiness.author.utils;

import java.nio.charset.StandardCharsets;
import java.util.Random;
import java.util.UUID;
import org.springframework.util.DigestUtils;
import com.cn.ym.log.Log;

public class StringUtil {

    public static boolean isEmpty(String text) {
        return text == null || text.length() == 0;
    }

    public static String ganToken() {
        return DigestUtils.md5DigestAsHex(UUID.randomUUID().toString().getBytes(StandardCharsets.UTF_8));
    }

    public static String genRandomCode() {
        Random random = new Random();
        int i = random.nextInt(999999);
        if (i < 100000) {
            i += 100000;
        }
        Log.info("genRandomCode === > {}"+ i);
        return String.valueOf(i);
    }
}
